// 文章模块
import { reqGetCateGory } from '@/api/article.js'
export default {
  state: {
    // 文章分类数据
    cateList: []
  },
  mutations: {
    // 设置cateList赋值的mutation
    setCateList (state, list) {
      state.cateList = list
    }
  },
  actions: {
    // 获取文章分类的数据
    async getCateList ({ commit }) {
      const { data } = await reqGetCateGory()
      // console.log(data)
      if (data.code === 0) {
        commit('setCateList', data.data)
      }
    }
  },
  getters: {},
  namespaced: true
}
